//-------------------------------------------------------------------
//	Copyright (c) 2010-2011  Zhirnov Andrey
//	This file is part of the "UXGEN_ResourceConverter" project.
//	See copyright notice in "Converter.h".
//-------------------------------------------------------------------

#ifndef _RC_UXGEN_TYPES_ADAPTER_H
#define _RC_UXGEN_TYPES_ADAPTER_H


//#define _UX_ENGINE_BUILD_VERSION_H
//#define _UX_ENGINE_VERSION_H
#define _UX_OS_EVENTS_H
#define _UX_MAIN_TYPES_H
#define _UX_BASE_OBJECT_H
#define _UX_POINTERS_H
#define _UX_ALL_ENGINE_SYSTEMS_H

#include "..\\..\\..\\Engine\\Include\\Includes.h"

#undef  LOG
#undef  RESTRICT
#define __gl_h_
#define __GL_H__
#define _UX_CORE_H



#ifdef _SHOW_FUNC_WARNING
#	undef  _SHOW_FUNC_WARNING
#	define _SHOW_FUNC_WARNING( _text, _level )
#endif

#ifdef _SHOW_FUNC_WARNING_EXT
#	undef  _SHOW_FUNC_WARNING_EXT
#	define _SHOW_FUNC_WARNING_EXT( _text, _level )
#endif


// Engine namespaces //

namespace Engine
{
	namespace Resources {}
	namespace FileSystem {}
	using namespace Resources;
	using namespace FileSystem;
}

using namespace Engine;


#include "..\\Converter.h"

#define	wchar	Converter::wchar
#define	int8	Converter::int8
#define	int16	Converter::int16
#define	int32	Converter::int32
#define	int64	Converter::int64
#define isize	Converter::isize

#define	uint8	Converter::uint8
#define	uint16	Converter::uint16
#define	uint32	Converter::uint32
#define	uint64	Converter::uint64
#define	uint	Converter::uint
#define usize	Converter::usize

using namespace Converter;

class CConverter;
class ILWrapper;


struct TSubSystems
{
	CConverter			*pConverter;
	ITextureConverter	*pTexConv;
	IFontConverter		*pFontConv;
	IModelConverter		*pModelConv;
	ISoundConverter		*pSoundConv;
	ITerrainConverter	*pTerConv;
	IVideoConverter		*pVidConv;
	ILWrapper			*pIL;
	ISpriteConverter	*pSprConv;
	///
	TSubSystems() { memset( this, 0, sizeof(*this) );  s_pSubSys = this; }

	static TSubSystems	*s_pSubSys;
};



class _EXPORT_ CEngBaseObject
{
public:
	CEngBaseObject() {}
	virtual ~CEngBaseObject() {}

	virtual void Release() = 0;
};


#define SYSTEMS					TSubSystems::s_pSubSys
#define CORE					SYSTEMS->pConverter

// LOG
#define ADD_TO_LOG( _text )		CORE->AddErrorString( _text )
#define ADD_TO_LOG_EX( _text )	CORE->AddErrorString( (string(_text) << "(file: " << __FILE__ << ", line: " << __LINE__).cstr() )
#define LOG( _text, _err )		ADD_TO_LOG( _text )
#define LOGE( _text, _err )		ADD_TO_LOG_EX( _text )


#endif	// _RC_UXGEN_TYPES_ADAPTER_H